import http from "@/utils/http";

export function getGoodsDetailAPI(id) {
    return http({
        url: '/api/goods',
        method: 'get',
        params: {
            id
        }
    })
}
//获取评论
export const getProductReviewsAPI = (productId) => {
    return http({
        url: `/order/api/review/getReviewDetail/${productId}`,
        method: 'get',
    })
}
/**
 * 获取热榜商品
 * @param {Number} id - 商品id
 * @param {Number} type - 1代表24小时热销榜 2代表周热销榜
 * @param {Number} limit - 获取个数
 */
export const getHotGoodsAPI = ({ id, type, limit = 3 }) => {
    return http({
        url: '/api/goods/hot',
        params: {
            id,
            type,
            limit
        }
    })
}